package org.huntaway.material.cleaner;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;

import org.huntaway.material.cleaner.enumerate.EnumCommand;
import org.huntaway.material.cleaner.manager.McManager;
import org.huntaway.material.cleaner.manager.model.ManagerVisitable;
import org.huntaway.material.cleaner.manager.model.ManagerVisitor;
import org.huntaway.material.cleaner.manager.model.imp.CommandManager;
import org.huntaway.material.cleaner.manager.model.imp.ManagerConcreteVisitor;
import org.huntaway.material.cleaner.manager.model.imp.MediaManager;
import org.huntaway.material.cleaner.manager.model.imp.PositionManager;
import org.huntaway.material.cleaner.manager.model.imp.TagsManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Commander {
	private final static Logger logger = LoggerFactory
			.getLogger(Material.class);

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// McManager.workDir=Commander.class.getResourceAsStream("/");
		Commander comm = new Commander();
		comm.run();
	}

	private void run() {
		ManagerVisitor visitor = new ManagerConcreteVisitor();
		Collection<ManagerVisitable> list = new ArrayList<ManagerVisitable>();
		list.add(new CommandManager());
		list.add(new MediaManager());
		list.add(new PositionManager());
		list.add(new TagsManager());

		visitor.visitCollection(list);
		McManager cm = new CommandManager();
		cm.showCurrInfo();
		cm.display();

		BufferedReader br = null;
		br = new BufferedReader(new InputStreamReader(System.in));
		String input;
		try {
			input = br.readLine();
			while (!input.equals(EnumCommand.EXIT)) {
				input = br.readLine();
				treate(input);
			}
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
	private void treate(String input) {
		// TODO Auto-generated method stub

	}

}
